Skip to content

implements ptc beacon apis#16306

Open
james-prysm wants to merge 28 commits intodevelopfrom
gloas-ptc-api
Open

implements ptc beacon apis#16306
james-prysm wants to merge 28 commits intodevelopfrom
gloas-ptc-api

Conversation

@james-prysm
Copy link
Copy Markdown
Contributor

@james-prysm james-prysm commented Jan 30, 2026

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Implements the following endpoints
GET /eth/v1/validator/payload_attestation_data/{slot}
POST /eth/v1/beacon/pool/payload_attestations
GET /eth/v1/beacon/pool/payload_attestations

NOTE: DOES NOT IMPLEMENT POOL AND USES INTERFACE STUBS, DOES NOT IMPLEMENT gRPC

Which issues(s) does this PR fix?

references ethereum/beacon-APIs#552

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have included a uniquely named changelog fragment file.
  • I have added a description with sufficient context for reviewers to understand this PR.
  • I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).


var data []*structs.PayloadAttestation
for _, att := range allAtts {
if rawSlot != "" && att.Data.Slot != primitives.Slot(slot) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is filtering this way safe? or is having a separate function on the pool better?

@james-prysm james-prysm marked this pull request as ready for review February 3, 2026 16:24

// PayloadStatusFetcher determines the payload presence and blob data availability
// for a given slot. This is used by PTC validators to produce PayloadAttestationData.
type PayloadStatusFetcher interface {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this would be implemented in pool package
i think this would be implemented in blockchainpackage
but i could be wrong

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the attestation pools live here under attestations folder so i thought it would be the same

@github-project-automation github-project-automation bot moved this to Backlog in Gloas Feb 11, 2026
@james-prysm james-prysm moved this from Backlog to In progress in Gloas Feb 11, 2026

atts := s.PayloadAttestationPool.PendingPayloadAttestations(primitives.Slot(slot))

var data []*structs.PayloadAttestation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pre-allocate this slice?

@nalepae
Copy link
Copy Markdown
Contributor

nalepae commented Mar 26, 2026

curl http://localhost:32838/eth/v1/validator/payload_attestation_data/0 | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   181  100   181    0     0  44221      0 --:--:-- --:--:-- --:--:-- 45250
{
  "version": "gloas",
  "data": {
    "beacon_block_root": "0x19d5791edc0bbe93e7d1ac9f453e7f91b3c1b9a2b6ccd78a94ba832dc27b9348",
    "slot": "0",
    "payload_present": false,
    "blob_data_available": false
  }
}

I get "version": "gloas" even if slot 0 is Fulu and current slot is Fulu.
Is that expected?

@nalepae
Copy link
Copy Markdown
Contributor

nalepae commented Mar 26, 2026

Also:

curl http://localhost:32838/eth/v1/validator/payload_attestation_data/1234567890123456789 | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   199  100   199    0     0  91874      0 --:--:-- --:--:-- --:--:-- 99500
{
  "version": "gloas",
  "data": {
    "beacon_block_root": "0xbef8eb08ce6833b1548fd3847ddea74aa73d23bbfbd81a652bc0cb02549a0d68",
    "slot": "1234567890123456789",
    "payload_present": false,
    "blob_data_available": false
  }
}

The slot is far in the future, however a value is returned.
Is that expected?

@nalepae
Copy link
Copy Markdown
Contributor

nalepae commented Mar 26, 2026

Also:

 curl http://localhost:32838/eth/v1/beacon/pool/payload_attestations\?slot\=32 | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    32  100    32    0     0   3026      0 --:--:-- --:--:-- --:--:--  3200
{
  "version": "gloas",
  "data": null
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants